package com.kaifamiao.base.Demo20210927;

import java.io.*;

/**
 * @author lucien-ma
 * @date 2021/9/27
 * @apiNote
 */
public class SerializableDemo02 {
    public static void main(String[] args) {
        try (
                FileInputStream fileInputStream = new FileInputStream("E:/test/student.txt");
                ObjectInputStream objectInputStream = new ObjectInputStream(fileInputStream);
                ) {
            Object object = objectInputStream.readObject();
            Student student = (Student) object;
            System.out.println(student);
        } catch (FileNotFoundException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        }
    }
}
